<?php
echo form_open_multipart('upload/update_file');
$items = $item['0'];
?>
<input type="hidden" name="idfile" value="<?php echo $items->id;?>" >
<input type="hidden" name="name" value="<?php echo $items->name;?>">
<input type="hidden" name="idCat" value="<?php echo $items->idCat;?>">
<input type="text" name="updatefile" value="<?php echo $items->name; ?>">
<?php
echo '<select name="parent" >';
echo '<option value="1" disabled>------root------</option>';
if ($menu != false) {
  foreach ($menu as $list_menu) {
    if ($list_menu['0']->idCat == $items->idCat) {
      echo '<option value="' . $list_menu['0']->idCat . '" style="background: rgb(218, 224, 75);" selected="selected">' . $list_menu['0']->nameCat . '</option>';
    } else {
      echo '<option value="' . $list_menu['0']->idCat . '" ' . $dis . '>' . $list_menu['0']->nameCat . '</option>';
    }

    //var_dump($list_menu['0']->nameCat);
    if (isset($list_menu['1'])) {
      foreach ($list_menu['1'] as $list_menu_sub) {
        if ($list_menu_sub->idCat == $items->idCat) {
          echo '<option value="' . $list_menu_sub->idCat . '" style="background: rgb(218, 224, 75);" selected="selected">&nbsp;&nbsp; - ' . $list_menu_sub->nameCat . '</option>';
        } else {
          echo '<option value="' . $list_menu_sub->idCat . '"' . $dis . ' >&nbsp;&nbsp; - ' . $list_menu_sub->nameCat . '</option>';
        }

      }
    }
  }
}
?>
<?php
echo '</select>';
echo '<input type="submit" value="Update">';
echo form_close();
$name_file = base64_encode(urlencode($items->name));
//$name_file = urlencode($items->name);
 $name_file = urlencode(base64_encode($items->name));


?>
<a href="<?php echo site_url('upload/delete_file/'.$items->id.'/'.$items->idCat.'/'.$name_file.'/');?>" >Delete</a>